package sqlparser;

public class GrantPrivilegeSqlParser extends BaseSingleSqlParser {

    public GrantPrivilegeSqlParser(String originalSql) {
        super(originalSql);
    }

    @Override
    protected void initializeSegments() {
        segments.add(new SqlSegment("(grant)(.+)(ON)", "[,]"));//找出权限列表
        segments.add(new SqlSegment("(ON)(.+)(TO)", "[.]"));//找出授给那个库的那个表
        segments.add(new SqlSegment("(TO)(.+)(@)", "[,]"));//账号
        segments.add(new SqlSegment("(IDENTIFIED BY)(.+)(ENDOFSQL)", "[,]"));//账户密码
    }
}
